import { http } from '@/utils/request'
import type { BaseTrademarkData, IResTrademarkInfo, IAddEditParams } from '@/types/trademark'

/**
 * @description 获取品牌列表
 * @param page 当前页码
 * @param limit 每页展示数量
 */
export const baseTrademark = (page: number, limit: number) => {
  return http<BaseTrademarkData>(`/admin/product/baseTrademark/${page}/${limit}`, 'GET')
}
/**
 * @description 添加品牌信息
 * @param logoUrl log路径
 * @param tmName 品牌名字
 */
export const reqAddTrademark = (data: IAddEditParams) => {
  return http('/admin/product/baseTrademark/save', 'POST', data)
}

/**
 * @description 删除品牌信息
 * @param id string  品牌id
 */
export const reqRemoveTrademark = (id: number) => {
  return http(`/admin/product/baseTrademark/remove/${id}`, 'DELETE')
}
/**
 * @description 获取品牌信息
 * @param id string 品牌id
 */
export const reqTrademark = (id: number) => {
  return http<IResTrademarkInfo>(`/admin/product/baseTrademark/get/${id}`, 'GET')
}
/**
 * @description 更新品牌信息
 * @param id string 品牌id
 * @param logoUrl 品牌log
 * @param tmName 品牌名字
 */
export const reqUpdateTrademark = (data: IAddEditParams) => {
  return http('/admin/product/baseTrademark/update', 'PUT', data)
}
/**
 * @description 获取全部品牌
 */
export const getAllTrademark = () => {
  return http<IResTrademarkInfo[]>('/admin/product/baseTrademark/getTrademarkList', 'GET')
}
